﻿<%@ Page Language="C#" MasterPageFile="~/SMS.master" AutoEventWireup="true" CodeFile="Register.aspx.cs" Inherits="Register" Title="Untitled Page" %>

<%-- Add content controls here --%><asp:Content ID="Content1" runat="server" 
    contentplaceholderid="MainContent">

                    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" 
        AnswerLabelText="密码提示回答：" AnswerRequiredErrorMessage="" CancelButtonText="取消" 
        CompleteSuccessText="注册成功！" ConfirmPasswordCompareErrorMessage="密码和确认密码不相同！" 
        ConfirmPasswordLabelText="确认密码：" ConfirmPasswordRequiredErrorMessage="" 
        ContinueButtonText="继续" Contract1hipProvider="AspNetSqlContract1hipProvider" 
        CreateUserButtonText="注册" EmailLabelText="电子邮箱：" EmailRequiredErrorMessage="" 
        FinishCompleteButtonText="完成" InvalidEmailErrorMessage="请输入一个有效的邮箱地址。" 
        InvalidPasswordErrorMessage="密码最短长度为 7，其中必须包含非字母数字字符。" 
        OnCreatedUser="CreateUserWizard1_CreatedUser" PasswordLabelText="密码：" 
        PasswordRequiredErrorMessage="" QuestionLabelText="密码提示问题：" 
        QuestionRequiredErrorMessage="" StartNextButtonText="下一步" 
        StepNextButtonText="下一步" StepPreviousButtonText="上一步" 
        UnknownErrorMessage="注册失败，请再试一次！" UserNameLabelText="用户名：" 
        UserNameRequiredErrorMessage="" Width="100%">
                        <WizardSteps>
                            <asp:CreateUserWizardStep ID="CreateUserWizardSetp" runat="server">
                                <ContentTemplate>
                                    <table border="0">
                                        <tr>
                                            <td align="center" colspan="2">
                                                填写注册个人资料</td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 126px">
                                                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">用户名：</asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="UserName" runat="server" Width="200px"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" 
                                                    ControlToValidate="UserName" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 126px">
                                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">密码：</asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="200px"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" 
                                                    ControlToValidate="Password" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 126px">
                                                <asp:Label ID="ConfirmPasswordLabel" runat="server" 
                                                    AssociatedControlID="ConfirmPassword">确认密码：</asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password" 
                                                    Width="200px"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" 
                                                    ControlToValidate="ConfirmPassword" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 126px">
                                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">电子邮箱：</asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="Email" runat="server" Width="350px"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" 
                                                    ControlToValidate="Email" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 126px">
                                                <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">密码提示问题：</asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="Question" runat="server" Width="350px"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" 
                                                    ControlToValidate="Question" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 126px">
                                                <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">密码提示回答：</asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:TextBox ID="Answer" runat="server" Width="350px"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" 
                                                    ControlToValidate="Answer" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 126px">
                                                <asp:Label ID="LabDepartment" runat="server" 
                                                    AssociatedControlID="DropDepartment">部门：</asp:Label>
                                            </td>
                                            <td align="left">
                                                <asp:DropDownList ID="DropDepartment" runat="server" 
                                                    DataSourceID="SqlDataSource1" DataTextField="Department" 
                                                    DataValueField="DepartmentID" Width="350px">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right" style="width: 126px">
                                                &nbsp;</td>
                                            <td align="left">
                                                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                                    ConnectionString="<%$ ConnectionStrings:smsConnectionString %>" 
                                                    SelectCommand="SELECT [DepartmentID], [Department] FROM [DepartmentInfo]">
                                                </asp:SqlDataSource>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2">
                                                <asp:CompareValidator ID="PasswordCompare" runat="server" 
                                                    ControlToCompare="Password" ControlToValidate="ConfirmPassword" 
                                                    Display="Dynamic" ErrorMessage="密码和确认密码不相同！" 
                                                    ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2" style="color: red">
                                                <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:CreateUserWizardStep>
                            <asp:CompleteWizardStep runat="server">
                                <ContentTemplate>
                                    <table border="0" style="font-size: 100%;">
                                        <tr>
                                            <td align="center" colspan="2">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                注册成功！</td>
                                        </tr>
                                        <tr>
                                            <td align="right" colspan="2">
                                                <asp:Button ID="ContinueButton" runat="server" CausesValidation="False" 
                                                    CommandName="Continue" PostBackUrl="~/Default.aspx" Text="继续" 
                                                    ValidationGroup="CreateUserWizard1" />
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:CompleteWizardStep>
                        </WizardSteps>
                        <StepNavigationTemplate>
                            <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" 
                                CommandName="MovePrevious" Text="上一步" />
                            <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" 
                                Text="下一步" />
                        </StepNavigationTemplate>
    </asp:CreateUserWizard>

</asp:Content>

